﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
namespace VBFOOL.MediaPlayer.Core.Interface
{
    public interface IInputSource
    {
        IEnumerable<IMediaTrack> Tracks { get; }
        IList<ICodecFactory> Codecs { get; }
        IMediaStream AudioStream { get; }
        IMediaStream VideoStream { get; }
        bool BuildStreams();
        bool CanSeek { get; }
        decimal Duration { get; }
        long Seek(long SeekToTime);
        IEnumerable<ISubtitleReader> Subtitles { get; }
        string Title { get; }
        void ChangeAudioTrack(MediaStreamDescription desc);
    }

    public interface IMediaTrack
    {
        MediaStreamDescription Description { get; }
        ICodecFilter Codec { get; }
        IInputSource Source { get; }
    }

    public interface IMediaStream
    {
        IInputSource Source { get; }
        IMediaTrack CurrentTrack { get; }
        FrameData GetFrame();

        double BufferProgress { get; }
        //object CodecVariable { get; set; }
    }

    public interface ICodecFactory
    {
        bool SupportCodecID(string CodecID);
        ICodecFilter CreateCodecFilter();
    }

    public interface ICodecFilter
    {
        IDictionary<MediaStreamAttributeKeys, string> GetCodecPrivateData(IDictionary<string, object> RawData);

        byte[] Translate(byte[] source, int offset, int count);

    }
}
